<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:s="http://jboss.org/schema/seam/taglib"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:rich="http://richfaces.org/rich"
  xmlns:a4j="http://richfaces.org/a4j"
  template="../WEB-INF/template/template_2x.xhtml">

  <ui:define
    name="page_title">#{msgs['jsf.ServerConfiguration']}</ui:define>
  <ui:define name="center_content">
    <h:form id="serverConfigForm">
      <s:token allowMultiplePosts="true"/>
      <rich:panel>
        <f:facet name="header">#{msgs['jsf.ServerConfiguration']}</f:facet>

        <s:decorate id="urlField" template="../WEB-INF/layout/edit.xhtml"
          enclose="true">
          <ui:define name="label">#{msgs['jsf.ServerUrl']}</ui:define>
          <h:inputText id="url" value="#{serverConfigurationBean.serverUrl}">
            <a4j:ajax event="blur" render="urlField"/>
          </h:inputText>
          <s:span styleClass="icon-info-circle-2 input_help" id="serverUrlHelp">
            <rich:tooltip>
              #{msgs['jsf.UrlToolTip']}<br/>
              <em><code>#{msgs['jsf.UrlExample']}</code></em>
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="registerField" template="../WEB-INF/layout/edit.xhtml"
          enclose="true">
          <ui:define name="label">#{msgs['jsf.RegisterUrl']}</ui:define>
          <h:inputText id="registerUrl" value="#{serverConfigurationBean.registerUrl}">
            <a4j:ajax event="blur" render="registerField"/>
          </h:inputText>

          <s:span styleClass="icon-info-circle-2 input_help"
            id="registerUrlHelp">
            <rich:tooltip>
              #{msgs['jsf.RegisterUrlToolTip']}<br/>
              <em><code>#{msgs['jsf.RegisterUrlExample']}</code></em>
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="emailDomainField"
          template="../WEB-INF/layout/edit.xhtml" enclose="true">
          <ui:define name="label">#{msgs['jsf.EmailDomainName']}</ui:define>
          <h:inputText id="emailDomain" value="#{serverConfigurationBean.emailDomain}"/>

          <s:span styleClass="icon-info-circle-2 input_help"
            id="emailDomainHelp">
            <rich:tooltip>
              #{msgs['jsf.EmailDomainNameToolTip']}
              <br/>
              <em><code>#{msgs['jsf.EmailDomainNameExample']}</code></em>
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="adminEmailField" template="../WEB-INF/layout/edit.xhtml"
          enclose="true">
          <ui:define
            name="label">#{msgs['jsf.config.AdminEmail']}</ui:define>
          <h:inputText id="adminEml"
            value="#{serverConfigurationBean.adminEmail}">
            <a4j:ajax event="blur" render="adminEmailField"/>
          </h:inputText>

          <s:span styleClass="icon-info-circle-2 input_help" id="adminEmllHelp">
            <rich:tooltip>
              #{msgs['jsf.config.AdminEmail.tooltip']}<br/>
              #{msgs['jsf.config.AdminEmail.DoesNotChangeUserEmail']}<br/>
              #{msgs['jsf.email.EmailListToolTip']}<br/>
              #{msgs['jsf.EmailToolTip']}<br/>
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="fromEmailField" template="../WEB-INF/layout/edit.xhtml"
          enclose="true">
          <ui:define
            name="label">#{msgs['jsf.config.FromEmailAddr']}</ui:define>
          <h:inputText id="fromEml"
            value="#{serverConfigurationBean.fromEmailAddr}">
            <a4j:ajax event="blur" render="fromEmailField"/>
          </h:inputText>

          <s:span styleClass="icon-info-circle-2 input_help" id="fromEmlHelp">
            <rich:tooltip>
              #{msgs['jsf.config.FromEmailAddr.tooltip']}<br/>
              #{msgs['jsf.EmailToolTip']}<br/>
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="enableLogEmailField"
          template="../WEB-INF/layout/edit.xhtml" enclose="true">
          <ui:define
            name="label">#{msgs['jsf.config.EnableLogEmails']}</ui:define>
          <h:selectBooleanCheckbox
            value="#{serverConfigurationBean.enableLogEmail}"/>

          <s:span styleClass="icon-info-circle-2 input_help"
            id="enableLogEmailHelp">
            <rich:tooltip>
              #{msgs['jsf.config.EnableLogEmails.tooltip']}<br/>
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="logDestEmailField"
          template="../WEB-INF/layout/edit.xhtml" enclose="true">
          <ui:define
            name="label">#{msgs['jsf.config.LogDestEmail']}</ui:define>
          <h:inputText id="logDestEml"
            value="#{serverConfigurationBean.logDestinationEmails}">
            <a4j:ajax event="blur" render="logDestEmailField"/>
          </h:inputText>

          <s:span styleClass="icon-info-circle-2 input_help"
            id="logDestEmailHelp">
            <rich:tooltip>
              #{msgs['jsf.config.LogDestEmail.tooltip']}<br/>
              #{msgs['jsf.email.EmailListToolTip']}<br/>
              #{msgs['jsf.EmailToolTip']}<br/>
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="logEmailLevelField"
          template="../WEB-INF/layout/edit.xhtml" enclose="true">
          <ui:define
            name="label">#{msgs['jsf.config.LogEmailLevel']}</ui:define>
          <h:selectOneMenu id="logEmailLvl"
            value="#{serverConfigurationBean.logEmailLevel}"
            style="width:156px; margin:0 3px 0 2px;">
            <f:selectItem itemLabel="#{msgs['jsf.Warning']}"
              itemValue="WARN"/>
            <f:selectItem itemLabel="#{msgs['jsf.Error']}"
              itemValue="ERROR"/>
          </h:selectOneMenu>

          <s:span styleClass="icon-info-circle-2 input_help"
            id="logEmailLevelHelp">
            <rich:tooltip>
              <h:outputLabel escape="true">
                #{msgs['jsf.config.LogEmailLevel.tooltip']}
              </h:outputLabel>
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="piwikUrlField" template="../WEB-INF/layout/edit.xhtml"
          enclose="true">
          <ui:define name="label">#{msgs['jsf.config.PiwikUrl']}</ui:define>
          <h:inputText id="piwikUrlEml"
            value="#{serverConfigurationBean.piwikUrl}">
            <a4j:ajax event="blur" render="piwikUrlField"/>
          </h:inputText>

          <s:span styleClass="icon-info-circle-2 input_help" id="piwikUrlHelp">
            <rich:tooltip>
              #{msgs['jsf.config.Piwiktooltip']}
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="piwikIdSiteField"
          template="../WEB-INF/layout/edit.xhtml" enclose="true">
          <ui:define
            name="label">#{msgs['jsf.config.PiwikIdSite']}</ui:define>
          <h:inputText id="piwikIdSiteEml"
            value="#{serverConfigurationBean.piwikIdSite}">
            <a4j:ajax event="blur" render="piwikIdSiteField"/>
          </h:inputText>

          <s:span styleClass="icon-info-circle-2 input_help"
            id="piwikIdSiteHelp">
            <rich:tooltip>
              #{msgs['jsf.config.PiwikIdSitetooltip']}
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="termsOfUseUrlField"
          template="../WEB-INF/layout/edit.xhtml" enclose="true">
          <ui:define
            name="label">#{msgs['jsf.config.TermsOfUseUrl']}</ui:define>
          <h:inputText id="termsOfUseUrlEml"
            value="#{serverConfigurationBean.termsOfUseUrl}">
            <a4j:ajax event="blur" render="termsOfUseUrlField"/>
          </h:inputText>

          <s:span styleClass="icon-info-circle-2 input_help"
            id="termsOfUseUrlHelp">
            <rich:tooltip>
              #{msgs['jsf.config.TermsOfUseUrltooltip']}
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="maxConcurrentPerApiKeyField"
          template="../WEB-INF/layout/edit.xhtml" enclose="true">
          <ui:define
            name="label">#{msgs['jsf.config.MaxConcurrentRequestsPerApiKey']}</ui:define>
          <h:inputText id="maxConcurrentPerApiKeyEml"
            value="#{serverConfigurationBean.maxConcurrentRequestsPerApiKey}">
            <a4j:ajax event="blur" render="maxConcurrentPerApiKeyField"/>
            <rich:placeholder value="default is 6" styleClass="txt--neutral" />
          </h:inputText>

          <s:span styleClass="icon-info-circle-2 input_help"
            id="maxConcurrentRequestPerApiKeyHelp">
            <rich:tooltip>
              #{msgs['jsf.config.MaxConcurrentRequestsPerApiKeytooltip']}
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <s:decorate id="maxActiveRequestsPerApiKeyField"
          template="../WEB-INF/layout/edit.xhtml" enclose="true">
          <ui:define
            name="label">#{msgs['jsf.config.MaxActiveRequestsPerApiKey']}</ui:define>
          <h:inputText id="maxActiveRequestsPerApiKeyEml"
            value="#{serverConfigurationBean.maxActiveRequestsPerApiKey}">
            <a4j:ajax event="blur"
              render="maxActiveRequestsPerApiKeyField"/>
            <rich:placeholder value="default is 2" styleClass="txt--neutral" />
          </h:inputText>

          <s:span styleClass="icon-info-circle-2 input_help"
            id="maxActiveRequestsPerApiKeyHelp">
            <rich:tooltip>
              #{msgs['jsf.config.MaxActiveRequestsPerApiKeytooltip']}
            </rich:tooltip>
          </s:span>
        </s:decorate>

        <div style="clear:both"/>

        <div class="actionButtons">
          <h:commandButton value="#{msgs['jsf.Save']}" id="save"
            action="#{serverConfigurationBean.update}"/>
          <s:button view="/admin/home.xhtml" value="#{msgs['jsf.Cancel']}" id="cancel"
            propagation="none"/>
        </div>

      </rich:panel>
    </h:form>
  </ui:define>
</ui:composition>
